Skip to content

PR previews + main publish to GitHub Pages#17

Merged
IanMayo merged 1 commit into
mainfrom
claude/pr-previews-gh-pages-a354wo
Jul 12, 2026
Merged

PR previews + main publish to GitHub Pages#17
IanMayo merged 1 commit into
mainfrom
claude/pr-previews-gh-pages-a354wo

Conversation

@IanMayo

@IanMayo IanMayo commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What

Publish the demonstrator's static surfaces to GitHub Pages, with a preview per PR and a live site from main.

ASSAY has no compiled SPA — the shippable "app" is static HTML: the SPEC-14 fixture-backed component gallery (npm run gallery) and the role-surface wireframes. This change assembles those into one site and wires two publish paths.

Changes

  • scripts/build-site.ts + npm run build:site — regenerates the gallery, then gathers gallery/, wireframes.html, and a small on-brand landing page into site/. Output is git-ignored (CI builds it, nothing is committed). Build metadata (commit SHA, PR number) labels a preview honestly when the environment provides it, and invents nothing when it doesn't.
  • .github/workflows/deploy-pages.yml — on push to main (and workflow_dispatch), publishes site/ to the gh-pages branch root via JamesIves/github-pages-deploy-action, with clean-exclude: pr-preview/ so a main deploy never wipes open PR previews.
  • .github/workflows/pr-preview.yml — on each PR (opened/reopened/synchronize/closed), uses rossjrw/pr-preview-action to publish site/ under pr-preview/pr-<N>/ and link it from a PR comment; on merge/close it removes the preview subtree and updates the comment. The build steps are skipped on close (teardown only).
  • .gitignore / package.json — ignore site/, add the build:site script.

Both workflows write to the shared gh-pages branch and coexist (main at the root, previews under pr-preview/).

Verification

  • npm run build:site produces site/{index.html, gallery/index.html, wireframes.html}; preview labelling verified with mock PR_NUMBER/GITHUB_SHA.
  • npm run typecheck clean (the new script is under tsconfig); npm test — 89 passing; the committed gallery output is byte-identical (regeneration is a no-op).
  • Workflow YAML parses.

One-time setup required

GitHub Pages must be set to Deploy from a branch → gh-pages / (root) in repo Settings → Pages for either workflow's output to be served. The gh-pages branch currently holds a stale source snapshot from PR #2; the first main deploy replaces it with the assembled site.

Note: previews use GITHUB_TOKEN, which has write scope only for same-repo branches, so PRs opened from forks won't get a preview (they'd need read-only handling via pull_request_target, which runs untrusted PR code in the base context and is deliberately avoided here).

🤖 Generated with Claude Code


Generated by Claude Code

Publish the demonstrator's static surfaces (the SPEC-14 component gallery
and the role-surface wireframes) to GitHub Pages.

- scripts/build-site.ts + `npm run build:site`: assemble the generated
  gallery and wireframes under site/ with a small landing page. Output is
  git-ignored; CI builds and publishes it. Build metadata (commit, PR
  number) labels a preview honestly when present.
- deploy-pages.yml: on push to main (and manual dispatch), publish site/
  to the gh-pages branch root, preserving pr-preview/ via clean-exclude.
- pr-preview.yml: on each PR, publish site/ to pr-preview/pr-<N>/ and link
  it from a PR comment; on merge/close, remove the preview and update the
  comment. Same-repo branches only (GITHUB_TOKEN write scope).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KzHCttj1aXztNBBanQq4Vp
@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-12 18:32 UTC

@IanMayo IanMayo merged commit 5d435f0 into main Jul 12, 2026
3 checks passed
IanMayo pushed a commit that referenced this pull request Jul 12, 2026
Adds the demonstrator's public-facing welcome page and turns the comms
plan's stage-gate progress cadence into a per-spec "plans -> achievements"
discipline, recorded register-first as a flagged candidate.

docs/assay-home.html — hand-authored Home/Overview (comms plan §4 page 1;
projects concept §1). Self-contained and static (comms plan §6.4): inline
CSS/SVG, no external assets, theme-aware (light/dark). Reuses the
demonstrator's own band-pill / four-stop verdict colour language (ui-design
§2, comms plan §8) so the site looks like the honesty it reports. Sections:
objectives + premise, the spine diagram (Knowledge -> Compile -> Score ->
Analyse -> Surfaces, status-coloured), links to the published surfaces
(gallery/, wireframes.html), theses A-H with honest state chips, a
progress/achievements tracker (Stage 0/1 done, Stage 2 in progress), a
clearly-labelled forthcoming-articles section (no dead link), the
banded-honesty stance, and the canonical-doc index. Honesty guardrails hold:
nothing shown as done the repository does not contain; the fictional Meridian
framing is stated on every relevant block.

Deployment note: the publish pipeline (PR #17, scripts/build-site.ts) copies
this file to the site root as index.html; its relative app links resolve once
deployed. Left unwired here to avoid conflicting with that in-flight work.

Process change (register-first, ASSAY-DEC-2):
- concept §6.12 — flagged candidate: each build spec carries a home-page-
  currency step in its definition of "done" when it moves a thesis/stage from
  planned to demonstrated. Not yet ratified.
- comms plan §9 + .specify/templates/tasks-template.md — the step wired in
  provisionally, marked pending ratification (the DEC-16 / sparse-channel
  "build against the flagged candidate" pattern).

npm test: 89 passing; typecheck clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vg1J8cqoCaAdUD1qMMnWS
IanMayo pushed a commit that referenced this pull request Jul 12, 2026
PR #17's publish pipeline is on main, so the deferred wiring is unblocked.
build-site.ts now copies the hand-authored Home page (docs/assay-home.html)
to site/index.html instead of generating a minimal inline landing, so the
demonstrator's front door is the reviewed, on-brand page rather than a stub.

Honest preview labelling is preserved: a <!--BUILD_BADGE--> placeholder in the
Home page is replaced with a "preview of PR #N · <sha>" badge only when
PR_NUMBER is set. Production (main) and local builds ship badge-free — a
preview must announce itself; the real site needs no label.

Verified: npm run build:site writes the Home page as root (gallery/ and
wireframes.html alongside); preview build injects the badge + commit link;
production build is clean. typecheck clean; committed gallery output
byte-identical (regeneration is a no-op).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vg1J8cqoCaAdUD1qMMnWS
@IanMayo IanMayo deleted the claude/pr-previews-gh-pages-a354wo branch July 13, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants